From 3b66390a75756e52571fdceee0d524f3f4984ce3 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Tue, 8 Feb 2005 23:17:38 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.555 (42094892MsTPGiy_x_uFbwMVQuq4Qg) Fix the synchronization issues between xend and the device model at startup time. Initialize the shared page in the hypervisor. Otherwise, the hypervisor might try to inject spurious interrupts into the guest due to uninitialized data. Signed-off-by: Xin B Li Signed-off-by: Arun Sharma Signed-off-by: ian@xensource.com --- tools/ioemu/iodev/main.cc | 1 + tools/ioemu/memory/misc_mem.cc | 3 --- tools/python/xen/xend/XendDomainInfo.py | 2 +- xen/arch/x86/vmx_vmcs.c | 4 ++++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/ioemu/iodev/main.cc b/tools/ioemu/iodev/main.cc index 763b8b2f7b..c784adb555 100644 --- a/tools/ioemu/iodev/main.cc +++ b/tools/ioemu/iodev/main.cc @@ -1781,6 +1781,7 @@ int bxmain () { // wxWindows under win32. int main (int argc, char *argv[]) { + daemon(0, 0); bx_startup_flags.argc = argc; bx_startup_flags.argv = argv; #if BX_WITH_SDL && defined(WIN32) diff --git a/tools/ioemu/memory/misc_mem.cc b/tools/ioemu/memory/misc_mem.cc index a69591dc1d..5d2b678531 100644 --- a/tools/ioemu/memory/misc_mem.cc +++ b/tools/ioemu/memory/misc_mem.cc @@ -189,9 +189,6 @@ BX_MEM_C::init_memory(int memsize) shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE, PROT_READ|PROT_WRITE, page_array[nr_pages - 1]); - - /* Initialize shared page */ - memset(shared_page, 0, PAGE_SIZE); } #endif // #if BX_PROVIDE_CPU_MEMORY diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 00fb2de04f..b2a8e6caea 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -855,7 +855,7 @@ class XendDomainInfo: + " -f %s" % device_config + " -d %d" % self.dom + " -p %d" % device_channel['port1'] - + " -m %s &" % memory) + + " -m %s" % memory) return deferred def device_create(self, dev_config): diff --git a/xen/arch/x86/vmx_vmcs.c b/xen/arch/x86/vmx_vmcs.c index c75620035f..1d5411bbfa 100644 --- a/xen/arch/x86/vmx_vmcs.c +++ b/xen/arch/x86/vmx_vmcs.c @@ -142,6 +142,10 @@ int vmx_setup_platform(struct exec_domain *d, execution_context_t *context) mpfn = phys_to_machine_mapping(gpfn); p = map_domain_mem(mpfn << PAGE_SHIFT); ASSERT(p != NULL); + + /* Initialise shared page */ + memset(p, 0, PAGE_SIZE); + d->arch.arch_vmx.vmx_platform.shared_page_va = (unsigned long) p; return 0; -- 2.30.2